//
// Copyright (C) [2024] Xingyun Integrated Circuit, Inc.
//
// GreenCode was a private technology asset of Xingyun Integrated Circuit， Inc （Confidential）
//  Author: Shawn.Tan
//  Date : 2025.10.28
//
//  History : Initial Version 2025.10.28
//
//
#ifndef Green_AluImmediateConstraint_H
#define Green_AluImmediateConstraint_H

#include "Defines.h"
#include "Enums.h"
#include ARCH_ENUM_HEADER

namespace Green {

  class ConstraintSet;

  /*!
    \class AluImmediateConstraint
    \brief Class for constructing constraint for ALU immediate type addressing mode.
  */
  class AluImmediateConstraint {
  public:
    AluImmediateConstraint(const EAluOperationType operationType, cuint32 offsetSize, cuint32 offsetShift); //!< Constructor with parameters.
    COPY_CONSTRUCTOR_ABSENT(AluImmediateConstraint);
    DESTRUCTOR_DEFAULT(AluImmediateConstraint);
    ASSIGNMENT_OPERATOR_ABSENT(AluImmediateConstraint);

    void GetConstraint(cuint64 baseValue, cuint32 accessSize, ConstraintSet* pResultConstr) const; //!< Get the ALU immediate constraint.
  private:
    const EAluOperationType mOperationType; //!< ALU operation type.
    uint64 mMaxOffset; //!< Maximum offset value.
  };

}

#endif
